package org.snusmumr.android.media.data.adapter;

import org.snusmumr.android.media.R;

import android.content.Context;
import android.database.Cursor;
import android.view.View;
import android.widget.ResourceCursorAdapter;
import android.widget.TextView;

public class LabelCursorAdapter extends ResourceCursorAdapter {

	public LabelCursorAdapter(Context context, Cursor c) {
		super(context, R.layout.label_content, c);
	}

	protected LabelCursorAdapter(Context context, int layout, Cursor c) {
		super(context, layout, c);
	}

	@Override
	public void bindView(View view, Context context, Cursor c) {
		TextView labelView = (TextView) view.findViewById(R.id.lb_content_label);
		labelView.setText(c.getString(1));
		
		TextView labelColor = (TextView) view.findViewById(R.id.lb_content_color);
		labelColor.setBackgroundColor(c.getInt(2));
	}

}
